package com.limuzi.controller;

import com.limuzi.model.ExceptionRequest;
import com.limuzi.model.PushMsgRequest;
import com.limuzi.util.DingTalkSendMsgUtils;
import org.springframework.web.bind.annotation.*;

/**
 * @author: limuzi
 * @create: 2023-06-26
 */
@RestController
@RequestMapping("/v1")
public class ExceptionController {
    @PostMapping("/DingTalkPush")
    public String pushException(@RequestBody ExceptionRequest request){

        return request.getParam1().substring(0,6);
    }
    @GetMapping("/PushMsg")
    public String pushMsg(@RequestBody PushMsgRequest msg){
        DingTalkSendMsgUtils.sendPushMsg(msg);
        return "ok";
    }
}
